package com.iflytek.web.listener;

import javax.servlet.annotation.WebListener;
import javax.servlet.http.HttpSession;
import javax.servlet.http.HttpSessionEvent;
import javax.servlet.http.HttpSessionListener;

//Session的监听器
@WebListener
public class SessionListener implements HttpSessionListener {

    @Override
    public void sessionCreated(HttpSessionEvent arg0) {
        HttpSession session = arg0.getSession();
        System.out.println(session.getId() + "已创建");
    }

    @Override
    public void sessionDestroyed(HttpSessionEvent arg0) {
        System.out.println(arg0.getSession().getId() + "已销毁");
    }
}